package org.noote.libs.robot;

import java.util.ArrayList;

import org.noote.libs.skeleton.Skeleton;

public class Robot_Skeleton extends Skeleton {
	
	protected ArrayList<Robot_ServoMotor> _servos = new ArrayList<Robot_ServoMotor>();
	
	public Robot_Skeleton() {
		super();
	}
	
	public Robot_ServoMotor newServo(int iIndex, int min, int moy, int max, float speed, boolean inversed)
	{
		Robot_ServoMotor new_servo = new Robot_ServoMotor(iIndex, min, moy, max, speed, inversed);
		_servos.add(new_servo);
		return new_servo;
	}
	
	public Robot_ServoMotor getServo(int iIndex)
	{
		for(Robot_ServoMotor servo : _servos)
		{
			if (servo.getID() == iIndex) return servo;
		}
		
		return null;
	}
	
	public ArrayList<Robot_ServoMotor> getServoList() {
		return _servos;
	}
}
